package com.bysc.commonutils.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ActivityEnum {


    NOT_START(0, "未开始"),
    JOIN_START(1, "报名中"),
    ONGOING(2, "进行中"),
    ENDED(3, "已结束");

    private final Integer id;
    private final String value;

    public static String getValueById(int activityId) {
        for (ActivityEnum activityEnum : ActivityEnum.values()) {
            if (activityEnum.getId() == activityId) {
                return activityEnum.getValue();
            }
        }
        throw new IllegalArgumentException("Invalid Activity activityId: " + activityId);
    }

}
